<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>工单管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
		});
	</script>
</head>
<body class="gray-bg">
	<div class="wrapper wrapper-content">
	<div class="ibox">
	<div class="ibox-title">
		<h5>工单列表 </h5>
	</div>
    <div class="ibox-content">
	<sys:message content="${message}"/>
	
	<!--查询条件-->
	<div class="row">
	<div class="col-sm-12">
	<form:form id="searchForm" modelAttribute="event" action="${ctx}/woms/event/" method="post" class="form-inline">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<table:sortColumn id="orderBy" name="orderBy" value="${page.orderBy}" callback="sortOrRefresh();"/><!-- 支持排序 -->
		<div class="form-group">
			<span>设备名称：</span>
				<form:input path="deviceName" htmlEscape="false" maxlength="256"  class=" form-control input-sm"/>
			<span>所属项目：</span>
				<form:select path="operationArea"  class="form-control m-b">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('operation_area')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			<span>所属单位：</span>
				<form:select path="subordinateUnits"  class="form-control m-b">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('subordinate_units')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
			<span>故障类型：</span>
				<form:select path="faultType"  class="form-control m-b">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('fault_type')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>

			<span>工单状态：</span>
			<form:select path="currentStatus"  class="form-control m-b">
				<form:option value="" label=""/>
				<form:options items="${fns:getDictList('current_event_status')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
			</form:select>
			<div class="pull-right">
				<button  class="btn btn-primary btn-sm " onclick="search()" ><i class="fa fa-search"></i> 查询</button>
			</div>
		 </div>	
	</form:form>
	<br/>
	</div>
	</div>
	
	<!-- 工具栏 -->
	<div class="row">
	<div class="col-sm-12">
		<div class="pull-left">

			<shiro:hasPermission name="woms:event:del">
				<table:delRow url="${ctx}/woms/event/deleteAll" id="contentTable"></table:delRow><!-- 删除按钮 -->
			</shiro:hasPermission>
			<shiro:hasPermission name="woms:event:import">
				<table:importZip url="${ctx}/woms/event/importZip"></table:importZip><!-- 导入按钮 -->
			</shiro:hasPermission>

			</div>
		
	</div>
	</div>
	
	<!-- 表格 -->
	<table id="contentTable" class="table table-striped table-bordered table-hover table-condensed dataTables-example dataTable">
		<thead>
			<tr>
				<th> <input type="checkbox" class="i-checks"></th>
				<th  class="column deviceName">设备名称</th>
				<th  class="sort-column deviceId">设备ID</th>
				<th  class="column subordinateUnits">所属单位</th>
				<th  class="column computerRoom">接入机房</th>
				<th  class="column route">网络路由</th>
				<th  class="column ip">IP地址</th>
				<th  class="column operationArea">所属项目</th>
				<th  class="column installPosition">安装位置</th>
				<th  class="column powerPosition">取电位置</th>
				<th  class="column faultType">故障类型</th>
				<%--<th  class="sort-column receiveTime">接收时间</th>
				<th  class="sort-column finishTime">处理完成时间</th>--%>
				<th width="8%">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="event">
			<tr>
				<td> <input type="checkbox" id="${event.id}" class="i-checks"></td>
				<td>
					${event.deviceName}
				</td>
				<td>
					${event.deviceId}
				</td>
				<td>
					${fns:getDictLabel(event.subordinateUnits, 'subordinate_units', '')}
				</td>
				<td>
					${event.computerRoom}
				</td>
				<td>
					${event.route}
				</td>
				<td>
					${event.ip}
				</td>
				<td>
					${fns:getDictLabel(event.operationArea, 'operation_area', '')}
				</td>
				<td>
					${event.installPosition}
				</td>
				<td>
					${event.powerPosition}
				</td>
				<td>
					${fns:getDictLabel(event.faultType, 'fault_type', '')}
				</td>
				<%--<td>
					<fmt:formatDate value="${event.receiveTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					<fmt:formatDate value="${event.finishTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>--%>
				<td>
					<c:if test="${event.status eq '10'&&not empty event.assigner }">
						<a href="#" onclick="openDialogView('工单分派', '${ctxFront}/assigner/assignUI?id=${event.id}&userId=${event.assigner.id}&agentId=1000002&from=admin','450px', '600px')" class="btn btn-danger btn-xs" ><i class="fa fa-search-plus"></i> 分派</a>
					</c:if>
					<a href="${ctx}/woms/event/detail?id=${event.id}" class="btn btn-info btn-xs"><i class="fa fa-search-plus"></i> 详情</a>
					<%--<a href="#" onclick="openDialogView('工单详情', '${ctx}/woms/event/form?id=${event.id}','800px', '500px')" class="btn btn-success btn-xs" ><i class="fa fa-edit"></i> 详情</a>--%>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	
		<!-- 分页代码 -->
	<table:page page="${page}"></table:page>
	<br/>
	<br/>
	</div>
	</div>
</div>
</body>
</html>